const fs = require('fs')
const path = require('path')
function injectRoute(app) {
  const files = fs.readdirSync(path.resolve(__dirname));
  files.map((item) => {
    if (item !== "index.js") {
      const route = require(path.join(__dirname, item));
      app.use(route.allowedMethods())
      app.use(route.routes())
    }
  })
}

module.exports = injectRoute